<!--
 * @Description:
 * @Author: dh
 * @Date: 2022-01-21 13:41:19
 * @LastEditors: dh
 * @LastEditTime: 2022-11-30 10:57:23
-->
<template>
	<div>
		<el-button type="danger" @click="emitMsg">触发msg事件</el-button>
	</div>
</template>

<script lang="ts">
import { getCurrentInstance } from 'vue';
export default {
	setup() {
		const instance = getCurrentInstance();

		const emitMsg = function () {
			instance?.proxy?.$bus.emit('msg');
		};
		return { emitMsg };
	},
};
</script>
